﻿using Downloader.Domain;
using Downloader.Web.Controllers.ViewModels;
using SharpArch.NHibernate;

namespace Downloader.Web.Controllers.Queries
{
    public class WebSiteInfoQuery : NHibernateQuery, IWebSiteInfoQuery
    {
        public WebSiteInfoViewModel GetWebInfo()
        {
            var query = Session.QueryOver<WebSiteInfo>();
            var webSiteInfo = query.SingleOrDefault();
            var webSiteInfoModel = new WebSiteInfoViewModel(webSiteInfo);
            return webSiteInfoModel;

        }
    }
}
